package com.example.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.common.result.Result;
import com.example.common.result.YiFeiException;
import com.example.entity.vo.ZnxVo;
import com.example.entity.yifei.Cmsme;
import com.example.entity.yifei.Cmsmv;
import com.example.entity.yifei.Cmsno;
import com.example.entity.yifei.SFCTE;
import com.example.service.CmsnoService;
import com.example.mapper.CmsnoMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* @author 14501
* @description 针对表【CMSNO】的数据库操作Service实现
* @createDate 2024-08-05 17:03:09
*/
@Service
public class CmsnoServiceImpl extends ServiceImpl<CmsnoMapper, Cmsno>
    implements CmsnoService{

    @Resource
    private CmsnoMapper cmsnoMapper;

    @Override
    public Result queryList(Integer current, Integer size) {
        try{
            Map<String,Object> map = new HashMap<>();
            IPage<Cmsno> iPage = new Page<>(current,size);
            IPage<Cmsno> cmsnoIPage = this.cmsnoMapper.selectPage(iPage, null);
            map.put("pages", cmsnoIPage.getPages());
            map.put("total", cmsnoIPage.getTotal());
            map.put("list", cmsnoIPage.getRecords());
            return Result.success(map);
        }catch (Exception e){
            throw new YiFeiException(500,"项目编号查询发生异常"+e.getMessage());
        }
    }
}




